import $axios from './$axios.js'

export const get_goods_all = async (pageIndex, pageSize) => {
  let result = await $axios({
    url: `/api/goods/all/${ pageIndex }/${ pageSize }`
  })

  return result
}

export const get_goods_search = async (name, order, orderName) => {
  let result = await $axios({
    url: `/api/goods/search/${ name }`,
    params: {
      order,
      orderName
    }
  })

  return result
}

export const get_goods = async id => {
  let result = await $axios({
    url: `/api/goods/${ id }`
  })

  return result
}